<template lang="html">
  <div class="win-bids-detail">
    <go-back></go-back>
    <div class="content-wrapper">
      <h2>{{detail.title}}</h2>
      <ul class="little-title">
        <!--<li>作者：{{detail.author}}</li>-->
        <li>阅读数：{{detail.readingAmount}}</li>
        <li>发布时间：{{detail.createdAt | timeFormat}}</li>
      </ul>
      <div v-html="detail.content"></div>
    </div>
  </div>
</template>

<script>
import {getDetail} from 'api/article.js'

import GoBack from 'components/index/goback/goback'

export default {
  data() {
    return {
      detail: {}
    }
  },
  created() {
    let id = this.$route.params.id
    this._getDetail(id)
  },
  methods: {
    _getDetail(id) {
      getDetail(id).then((res) => {
        this.detail = res
      })
    }
  },
  components: {
    GoBack
  }
}
</script>

<style lang="scss">
.win-bids-detail{
  .line{
    height: 44px;
    background: rgba(231,231,231,0.2);
    border-bottom: 1px solid rgba(221,221,221,0.5);
    width: 1200px;
    margin-left: 18%;
    span{
      font-size: 14px;
      color: #777;
      line-height: 44px;
      margin-left: 10px;
      cursor: pointer;
    }
  }
  .btn{
    width: 167px;
    height: 40px;
    background: #4f89fe;
    text-align: center;
    line-height: 40px;
    margin-left: 19%;
    margin-top: -7px;
    cursor: pointer;
    p{
      color: #fff;
    }
  }
  .content-wrapper{
    width: 1200px;
    margin: 0 auto 50px;
    padding-bottom: 5%;
    h2{
      font-size: 30px;
      text-align: center;
      margin-top: 50px;
      margin-bottom: 30px;
    }
    .little-title{
      display: flex;
      justify-content: center;
      padding-bottom: 80px;
      color: #777777;
      li:not(:last-child){
        padding-right:30px;
      }
    }
    div{
      /*width: 600px;*/
      /*margin-left: 300px;*/
      p{
        font-size: 16px;
        line-height: 30px;
        img{
          text-align: center;
          width: 300px;
          height: 300px;
          padding-top: 30px;
          padding-bottom: 30px;
        }
      }
    }
  }
}
</style>
